﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:WpfHeroTutorial="clr-namespace:WpfHeroTutorial"
    x:Class="WpfHeroTutorial.Window1"
    Title="Window1" Height="388" Width="901" xmlns:WpfHero="clr-namespace:WpfHero;assembly=WHEngine">
	<Window.Resources>
		<WpfHeroTutorial:BooleanToBoldConverter x:Key="BooleanToBoldConverter"/>
		<SolidColorBrush x:Key="ListBorder" Color="#828790"/>
		<Style x:Key="SongBrowserStyle" TargetType="{x:Type ListBox}">
			<Style.Resources>
				<Storyboard x:Key="Storyboard1">
					<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="{x:Null}" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
						<SplineColorKeyFrame KeyTime="00:00:01" Value="#FFFFBC08"/>
					</ColorAnimationUsingKeyFrames>
				</Storyboard>
				<Storyboard x:Key="Storyboard_Copy1">
					<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="{x:Null}" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
						<SplineColorKeyFrame KeyTime="00:00:01" Value="#FFFFFFFF"/>
					</ColorAnimationUsingKeyFrames>
				</Storyboard>
			</Style.Resources>
			<Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListBox}">
						<Border SnapsToDevicePixels="true" x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1">
							<ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}">
								<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
							</ScrollViewer>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
							</Trigger>
							<Trigger Property="IsGrouping" Value="true">
								<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Style.Triggers>
				<Trigger Property="IsMouseOver" Value="True">
					<Trigger.ExitActions>
						<BeginStoryboard Storyboard="{StaticResource Storyboard_Copy1}" x:Name="Storyboard_Copy1_BeginStoryboard"/>
					</Trigger.ExitActions>
					<Trigger.EnterActions>
						<BeginStoryboard Storyboard="{StaticResource Storyboard1}"/>
					</Trigger.EnterActions>
				</Trigger>
			</Style.Triggers>
		</Style>
		<ObjectDataProvider x:Key="SongBrowserDS" d:IsDataSource="True" ObjectType="{x:Type WpfHeroTutorial:SongBrowser}"/>
		<DataTemplate x:Key="SubDirectoriesTemplate">
			<StackPanel>
				<TextBlock Text="{Binding Path=Name, Mode=OneWay}" FontWeight="{Binding Path=HasSong, Converter={StaticResource BooleanToBoldConverter}, Mode=Default}"/>
			</StackPanel>
		</DataTemplate>
		<ObjectDataProvider x:Key="WHEngineDS" d:IsDataSource="True" ObjectType="{x:Type WpfHero:WHEngine}"/>
		<Storyboard x:Key="OnTextChanged1">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="textBlock" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
				<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="3.4"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="textBlock" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
				<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="3.1"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="textBlock" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
				<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="5"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="textBlock" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
				<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="29"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="textBlock" Storyboard.TargetProperty="(UIElement.Opacity)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
				<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
				<SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="ShowLoading">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lbSongBrowser" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
				<SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="-229.5"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lbSongBrowser" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
				<SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="-9"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="scroller" Storyboard.TargetProperty="(UIElement.Opacity)">
				<SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="StartPlaying"/>
	</Window.Resources>
	<Window.Triggers>
		<EventTrigger RoutedEvent="TextBoxBase.TextChanged" SourceName="tbMissed">
			<BeginStoryboard Storyboard="{StaticResource OnTextChanged1}"/>
		</EventTrigger>
	</Window.Triggers>
    <Grid>
        <ListBox Margin="20,97,0,27" x:Name="lbSongBrowser" Style="{DynamicResource SongBrowserStyle}" ItemsSource="{Binding Path=SubDirectories, Mode=Default, Source={StaticResource SongBrowserDS}}" ItemTemplate="{DynamicResource SubDirectoriesTemplate}" MouseDoubleClick="lbSongBrowser_MouseDoubleClick" KeyUp="lbSongBrowser_KeyUp" Width="165" HorizontalAlignment="Left" RenderTransformOrigin="0.5,0.5" >
        	<ListBox.RenderTransform>
        		<TransformGroup>
        			<ScaleTransform ScaleX="1" ScaleY="1"/>
        			<SkewTransform AngleX="0" AngleY="0"/>
        			<RotateTransform Angle="0"/>
        			<TranslateTransform X="0" Y="0"/>
        		</TransformGroup>
        	</ListBox.RenderTransform>
        </ListBox>
        <StackPanel Margin="20,8,21,0" VerticalAlignment="Top" Height="62" Orientation="Horizontal">
        	<TextBox Text="Score" TextWrapping="Wrap"/>
        	<TextBox Text="{Binding Path=Score, Mode=Default, Source={StaticResource WHEngineDS}}" TextWrapping="Wrap"/>
        	<TextBox Text="Hits" TextWrapping="Wrap"/>
        	<TextBox Text="{Binding Path=TotalHits, Mode=Default, Source={StaticResource WHEngineDS}}" TextWrapping="Wrap"/>
        	<TextBox Text="Hits in a row" TextWrapping="Wrap"/>
        	<TextBox Text="{Binding Path=HitsInARow, Mode=Default, Source={StaticResource WHEngineDS}}" TextWrapping="Wrap"/>
        	<TextBox TextWrapping="Wrap" Text="Missed"/>
        	<TextBox Text="{Binding Path=MissedGemCount, Mode=Default, Source={StaticResource WHEngineDS}}" TextWrapping="Wrap" x:Name="tbMissed"/>
        	<TextBox Text="Unneccessary strums" TextWrapping="Wrap"/>
        	<TextBox Text="{Binding Path=UnneccessaryStrums, Mode=Default, Source={StaticResource WHEngineDS}}" TextWrapping="Wrap"/>
        	<TextBox Text="Multiplier" TextWrapping="Wrap"/>
        	<TextBox Text="{Binding Path=Multiplier, Mode=Default, Source={StaticResource WHEngineDS}}" TextWrapping="Wrap"/>
        </StackPanel>
        <ToggleButton d:LayoutOverrides="Width, Height" HorizontalAlignment="Left" Margin="258,97,0,0" VerticalAlignment="Top" Content="F1" IsChecked="{Binding Path=IsButton1Pressed, Mode=Default, Source={StaticResource WHEngineDS}}"/>
        <ToggleButton HorizontalAlignment="Left" Margin="258,151.96,0,0" VerticalAlignment="Top" Content="F2" IsChecked="{Binding Path=IsButton2Pressed, Mode=Default, Source={StaticResource WHEngineDS}}"/>
        <ToggleButton d:LayoutOverrides="Height" HorizontalAlignment="Left" Margin="258,0,0,131.12" VerticalAlignment="Bottom" Content="F3" IsChecked="{Binding Path=IsButton3Pressed, Mode=Default, Source={StaticResource WHEngineDS}}"/>
        <ToggleButton d:LayoutOverrides="Height" HorizontalAlignment="Left" Margin="258,0,0,86.16" Content="F4" IsChecked="{Binding Path=IsButton4Pressed, Mode=Default, Source={StaticResource WHEngineDS}}" VerticalAlignment="Bottom"/>
        <ToggleButton d:LayoutOverrides="Height" HorizontalAlignment="Left" Margin="258,0,0,35.2" VerticalAlignment="Bottom" Content="F5" IsChecked="{Binding Path=IsButton5Pressed, Mode=Default, Source={StaticResource WHEngineDS}}"/>
        <ToggleButton HorizontalAlignment="Left" VerticalAlignment="Bottom" Content="Shift" Margin="214,0,0,18.24" d:LayoutOverrides="Height" IsChecked="{Binding Path=IsStrumKeyPressed, Mode=Default, Source={StaticResource WHEngineDS}}"/>
        <WpfHeroTutorial:HorizontalScroller HorizontalAlignment="Left" VerticalAlignment="Top" Margin="305.33,89,0,0" Height="255" DataContext="{Binding Mode=OneWay, Source={StaticResource WHEngineDS}}" x:Name="scroller"/>
        <TextBlock HorizontalAlignment="Right" Margin="0,8,249,0" VerticalAlignment="Top" Width="45" Height="23" Text="MISS!" TextWrapping="Wrap" RenderTransformOrigin="0.5,0.5" x:Name="textBlock" Opacity="0">
        	<TextBlock.RenderTransform>
        		<TransformGroup>
        			<ScaleTransform ScaleX="1" ScaleY="1"/>
        			<SkewTransform AngleX="0" AngleY="0"/>
        			<RotateTransform Angle="0"/>
        			<TranslateTransform X="0" Y="0"/>
        		</TransformGroup>
        	</TextBlock.RenderTransform>
        </TextBlock>
		
    </Grid>
</Window>
